import java.util.Arrays;


public class Remove_Duplicates {
    public void Remove(int[] arr) {
        int n = 1;
        int s = 1;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] != arr[i - 1]) {
                n++;
            }
        }
        int[] arrs = new int[n];
        arrs[0] = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] != arr[i - 1]) {
                arrs[s++] = arr[i];
            }
        }
        System.out.println(n+", nums = "+ Arrays.toString(arrs));
    }

        public static void main(String[] args) {
        int[] array = {0,1,1,2,3,3,4,5,6,6};
        Remove_Duplicates remove_duplicates = new Remove_Duplicates();
        remove_duplicates.Remove(array);

    }
}
